#ifndef SPRITERENDERER_H
#define SPRITERENDERER_H

#include "components/Renderer.h"
#include "types/Image.h"

namespace SolidityEngine{

class SpriteRenderer : public Renderer
{
    protected:
        Image* _image;
        Vector2D _pivot;
        Rect _subimagerect;

    public:
        SpriteRenderer(Image* img = NULL, const Vector2D& pivot = Vector2D(0.5f,0.5f), RenderTarget target = Renderer::RT_SCENE);
        virtual ~SpriteRenderer();

        void SetSubImage(const Rect& coords);

        void SetImage(Image* image);

        Vector2D& Pivot(){return _pivot;};
        Vector2D Pivot() const {return _pivot;};

        Image* GetImage();

    private:
        virtual void _Render(SDL_Surface* surface);
        virtual SpriteRenderer* _Clone();
};

};
#endif // SPRITERENDERER_H
